package com.itbaizhan.rabbitmq3.consumer;

import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

//消费者  不停地监听队列
//启动项目Rabbitmq3Application.java就可以接收信息
@Component
public class Consumer {
    //监听队列
    @RabbitListener(queues = "boot_queue")
    //直接写参数String message 就可以，springboot会自动把字节数组打包好
    public void listenerMessage(String message){
        System.out.println("发送短信："+message);
    }


}
